package cn.melon.view.control;

import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 * @ClassName: MouseLocationAdapter
 * @author Hzy
 * 监听器，在鼠标点击JFrame时获得当前鼠标在窗口位置，并准备返回给拖动窗口部分
 */
public class MouseLocationAdapter implements MouseListener{
	private Point origin = new Point();//鼠标在窗口的位置
	public MouseLocationAdapter(){
//		Do nothing
	}
	@Override
	public void mousePressed(MouseEvent e){
		origin.x = e.getX();
		origin.y = e.getY();
	}
	public Point getOriginPoint(){
		return origin;
	}
	@Override
	public void mouseClicked(MouseEvent e){
//		Do nothing
	}
	@Override
	public void mouseEntered(MouseEvent e){
//		Do nothing
	}
	@Override
	public void mouseExited(MouseEvent e){
//		Do nothing
	}
	@Override
	public void mouseReleased(MouseEvent e){
//		Do nothing
	}
	
}
